<?php
/***********************************************
	This class would scrape the entire content
	from the parameter $url.
************************************************/
class ContentScraper {
	private $curlHandle = NULL;
	private $scrapedContent = NULL;
	
	/************************************************************/
	
	function scrapeContent($url) {
		$this->curlHandle = curl_init($url);
		
		curl_setopt($this->curlHandle, CURLOPT_SSL_VERIFYPEER, FALSE);
		curl_setopt($this->curlHandle, CURLOPT_HEADER, FALSE);
		curl_setopt($this->curlHandle, CURLOPT_FOLLOWLOCATION, TRUE);
		curl_setopt($this->curlHandle, CURLOPT_URL, $url);
		curl_setopt($this->curlHandle, CURLOPT_REFERER, $url);
		curl_setopt($this->curlHandle, CURLOPT_RETURNTRANSFER, TRUE);
		
		$this->scrapedContent = curl_exec($this->curlHandle);
		curl_close($this->curlHandle);
		return $this->scrapedContent;
	}
}
?>